<?php
class Login_model extends CI_Model {


	function check_user($email,$pwd){
		$this->load->database();
		$hash_pwd = MD5($pwd);
		$query = "select email,pwd from users where email = ? and pwd = ?";
		$result = $this->db->query($query,array($email,$hash_pwd));
		
		if($result->num_rows() == 1){

			return $result->row(0)->email;
		} else {

			return false;
		}
	}
}
?>